package com.lizi.apidoc.model;

/**
 * Api对象信息-属性
 *
 * @author kingman zhangjw@3vjia.com
 * @since 2020-04-30 10:06
 */
public class ApiObjectProperty {

    public ApiObjectProperty(){
        nullable = true;
    }

    /**
     * 属性名称
     */
    private String name;
    /**
     * 类型 integer
     */
    private String type;
    /**
     * 描述
     */
    private String description;
    /**
     * 格式 int32
     */
    private String format;
    /**
     * 可为空，默认true
     */
    private boolean nullable;
    /**
     * require flag
     */
    private boolean required;
    /**
     * version
     */
    private String version;
    /**
     * field full class name
     */
    private String fieldFullClassName;
    /**
     * 参照对象，若type为object时
     */
    private String ref;
    /**
     * 数组信息，若type为array时
     */
    private ApiObjectProperty items;
    //private List<ApiObjectProperty> items;


    public static ApiObjectProperty of(){
        return new ApiObjectProperty();
    }

    public String getName() {
        return name;
    }

    public ApiObjectProperty setName(String name) {
        this.name = name;
        return this;
    }

    public String getType() {
        return type;
    }

    public ApiObjectProperty setType(String type) {
        this.type = type;
        return this;
    }

    public String getDescription() {
        return description;
    }

    public ApiObjectProperty setDescription(String description) {
        this.description = description;
        return this;
    }

    public String getFormat() {
        return format;
    }

    public ApiObjectProperty setFormat(String format) {
        this.format = format;
        return this;
    }

    public boolean isNullable() {
        return nullable;
    }

    public ApiObjectProperty setNullable(boolean nullable) {
        this.nullable = nullable;
        return this;
    }

    public boolean isRequired() {
        return required;
    }

    public ApiObjectProperty setRequired(boolean required) {
        this.required = required;
        return this;
    }

    public String getVersion() {
        return version;
    }

    public ApiObjectProperty setVersion(String version) {
        this.version = version;
        return this;
    }

    public String getFieldFullClassName() {
        return fieldFullClassName;
    }

    public ApiObjectProperty setFieldFullClassName(String fieldFullClassName) {
        this.fieldFullClassName = fieldFullClassName;
        return this;
    }

    public String getRef() {
        return ref;
    }

    public ApiObjectProperty setRef(String ref) {
        this.ref = ref;
        return this;
    }

    public ApiObjectProperty getItems() {
        return items;
    }

    public ApiObjectProperty setItems(ApiObjectProperty items) {
        this.items = items;
        return this;
    }
}
